package com.seaengine.valueobject
{
	import com.seaengine.staticdata.GYPropertyConfiguration;
	

	public class RefiningRuleVo extends BaseVo
	{
		public function RefiningRuleVo(money:int, ingot:int)
		{
			super();
			this.money = money;
			this.ingot = ingot;
		}

		public var money:int;
		public var ingot:int;
		
		public var props:Array;
		
		public function getPercent(propType:int,value:int, lvl:int):int
		{
			return 100 * value / getPropValue(propType) / lvl;
		}
		
		private function getPropValue(type:int):int
		{
			for each(var pc:GYPropertyConfiguration in props)
			{
				if(pc.propType == type)
				{
					return pc.value;
				}
			}
			return 0;
		}
	}
}
